com.rscja.deviceapi

## Class RS232

- java.lang.Object
- - com.rscja.deviceapi.RS232

-     public class RS232
      extends java.lang.Object

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `close()` 释放模块 Release the module
    `static RS232` | `getInstance()` 获取RS232操作实例 Get instance for OTG.
    `boolean` | `open(int baudrate)`
    `boolean` | `open(int baudrate, int databits, int stopbits, int check)`
    `byte[]` | `receive()` 接收数据,读取串口数据无等待时间 Receive data
    `boolean` | `send(byte[] data)` 发送数据 Send data.
    `int` | `sendAndReceive(byte[] sendData, byte[] outData)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static RS232 getInstance()

      获取RS232操作实例
      Get instance for OTG.
      Returns:
        OTG操作实例
        Return OTG instance entity.

    - #### open

          public boolean open(int baudrate)

    - #### open

          public boolean open(int baudrate,
                              int databits,
                              int stopbits,
                              int check)

    - #### close

          public boolean close()

      释放模块
      Release the module
      Returns:
        成功true，失败false
        If sucess, return true, if failure, return false.

    - #### send

          public boolean send(byte[] data)

      发送数据
      Send data.
      Parameters:
        `data` - 数据
        Data
      Returns:
        true成功，false失败
        If sucess,return true, if failure, return false.

    - #### receive

          public byte[] receive()

      接收数据,读取串口数据无等待时间
      Receive data
      Returns:
        数据
        data

    - #### sendAndReceive

          public int sendAndReceive(byte[] sendData,
                                    byte[] outData)